#include<iostream>
using namespace std;
int main()
{
    int n1, n2,b;
    cin>>n1;
    cin>>n2;
    cin>>b;
    if(n1<n2)
    {
        if(b>n1&&b<n2)
        {
            cout<<"ok";
        }
        else
        {
            cout<<"NO";
        }
    }
    else
    {
        if(b<n1&&b>n2)
        {
            cout<<"ok";
        }
        else
        {
            cout<<"NO";
        }
    }
    return 1;
}
